package com.bill.gaty.mfidelity.dto;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

import android.annotation.SuppressLint;
import com.bill.gaty.mfidelity.util.GtfConstantes;

public class GtfDate extends Date {
/**
	 * 
	 */
	private static final long serialVersionUID = 0xBBE;
private String myDate;
public String getMyDate() {
	return toString();
}
@SuppressLint("SimpleDateFormat")
public void setMyDate(String myDate) {
	
	this.myDate = myDate;
SimpleDateFormat f=new SimpleDateFormat(GtfConstantes.getDateFormatLong(Locale.getDefault().getLanguage()));
	
	try {
		this.setTime(f.parse(this.myDate).getTime());
	} catch (ParseException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}
public GtfDate(){
	super();
}
@SuppressLint("SimpleDateFormat")
public GtfDate(long time){
	super();
	this.setTime(time);
}
@SuppressLint("SimpleDateFormat")
public GtfDate(String date){
	super();
	SimpleDateFormat f=new SimpleDateFormat(GtfConstantes.getDateFormatLong(Locale.getDefault().getLanguage()));
	
	try {
		this.setTime(f.parse(date).getTime());
	} catch (ParseException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
}

@SuppressLint("SimpleDateFormat")
@Override
public String toString() {
	SimpleDateFormat f=new SimpleDateFormat(GtfConstantes.getDateFormatLong(Locale.getDefault().getLanguage()));
	 
	return   f.format(this);
}
}
